console.log("----------------");
console.log("vue2 核心 代理  ");
console.log("----------------");
console.log("\n\n");

let me = { money: "我的100" };
let boss = "";

console.log("me.money  :", me.money); // "我的都是老板的"
console.log("boss      :", boss); // "我的都是老板的"

Object.defineProperty(me, "money", {
  get: function () {
    console.warn("get: ");
    return boss;
  },
  set: function (newVal) {
    console.warn("set: ", newVal);
    boss = newVal;
  },
});


console.log("\n-------- get --------");

console.log("me.money  :", me.money); 
console.log("boss      :", boss);

console.log("\n-------- set --------");

me.money = "我的10";
console.log("me.money  :", me.money); // "我的都是老板的"
console.log("boss      :", boss); // "我的都是老板的"
